package FlyweightMod;

public class code {

    // 抽象账户类
    abstract class Account {

        protected String permission;

        public Account(String permission) {
            this.permission = permission;
        }

        public abstract void display();

        public String getPermission() {
            return permission;
        }
    }

// 具体账户类：普通用户
    class Normal extends Account {

        public Normal(String permission) {
            super(permission);
        }

        @Override
        public void display() {
            System.out.println("Normal Account: Permission - " + permission);
        }
    }

// 具体账户类：VIP用户
    class VIP extends Account {

        public VIP(String permission) {
            super(permission);
        }

        @Override
        public void display() {
            System.out.println("VIP Account: Permission - " + permission);
        }
    }

// 具体账户类：超级VIP用户
    class SuperVIP extends Account {

        public SuperVIP(String permission) {
            super(permission);
        }

        @Override
        public void display() {
            System.out.println("SuperVIP Account: Permission - " + permission);
        }
    }

}
